using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace CTP.Entitys
{
    /// <summary>
    /// 委托单结构
    /// </summary>
    public struct Order
    {
        /// <summary>
        /// 资金账号
        /// </summary>
        public string UserAccount;
        /// <summary>
        /// 合约
        /// </summary>
        public string Code;
        /// <summary>
        /// 单号
        /// </summary>
        public string OrderID;
        /// <summary>
        /// 市场代码，下单回应后才有该字段
        /// </summary>
        public string ExchangeID;
        /// <summary>
        /// 买卖方向
        /// </summary>
        public Side Side;
        /// <summary>
        /// 开平方向
        /// </summary>
        public OpenClose OpenClose;
        /// <summary>
        /// 委托数量
        /// </summary>
        public double Amount;
        /// <summary>
        /// 单位
        /// </summary>
        public Unit Unit;
        /// <summary>
        /// 委托价格--任意市价模式都传0
        /// </summary>
        public double Price;
        /// <summary>
        /// 价格模式
        /// </summary>
        public PriceMode PriceMode;
        /// <summary>
        /// 单状态
        /// </summary>
        public OrderState OrderState;
        /// <summary>
        /// 委托单本地ID，当委托单回报时将会回传该ID号，以此标识委托回报所属的委托单
        /// </summary>
        public string OrderRef;
        /// <summary>
        /// 最后修改时间
        /// </summary>
        public string UpdateTimeStamp;
        /// <summary>
        /// 已成数量
        /// </summary>
        public double FilledAmount;
        /// <summary>
        /// 投机套保标志
        /// </summary>
        public HedgeFlag HedgeFlag;
        /// <summary>
        /// 相关信息
        /// </summary>
        public string Info;
    }
}
